[mysqld]
user=mysql
port={{ mysql.port }}
basedir=/usr
datadir=/mysql/product/data
symbolic-links=0
open_files_limit=65535
server_id={{ server_id }}
pid-file=/run/mysqld/mysqld.pid
socket=/run/mysqld/mysqld.sock

#开启GTID
gtid_mode=on
enforce_gtid_consistency=on
log-slave-updates=on


#会话参数
max_connections=4532
max_user_connections=4000
max_connect_errors=50000
wait_timeout=7200
interactive_timeout=7200
thread_cache_size=256


#binlog日志参数
max_binlog_size = 1073741824
log-bin=/mysql/product/binlog/mysql-bin
relay_log=/mysql/product/relaylog/mysql-relay-bin
binlog_cache_size=131072
binlog_error_action=ABORT_SERVER
binlog_format=ROW
expire_logs_days=30
sync_binlog=1
#慢日志参数
slow_query_log=0
long_query_time=10
log_output=FILE
log_error=/mysql/product/log/myerror.log
slow_query_log_file = /mysql/product/log/mysql-slow.log
general_log = OFF
general_log_file = /mysql/product/log/mysql-general.log


#Redo日志参数
innodb_log_group_home_dir = /mysql/product/redo
innodb_log_file_size=1048576000
innodb_log_files_in_group=3
#缓存参数
sort_buffer_size=720896
read_buffer_size=720896
read_rnd_buffer_size=360448
join_buffer_size=360448
max_allowed_packet=1073741824
max_heap_table_size=16777216
tmp_table_size=16777216
#innodb参数
innodb_buffer_pool_size=134217728
innodb_data_file_path=ibdata1:200M:autoextend
innodb_file_per_table=ON
innodb_log_buffer_size=16777216
innodb_flush_method=O_DIRECT
innodb_undo_directory = /mysql/product/undo
innodb_undo_tablespaces = 2
innodb_flush_log_at_trx_commit=1
innodb_temp_data_file_path = ibtmp1:200M:autoextend
#事务隔离级别
transaction-isolation=READ-COMMITTED
#字符集
character_set_server=utf8mb4
#查询缓存
query_cache_size=0
query_cache_type=OFF
#设置时区
default_time_zone='+8:00'
explicit_defaults_for_timestamp=1
#大小写不敏感
lower_case_table_names=1
log_bin_trust_function_creators=1


#多源复制必须的参数
master-info-repository = table                 # 这个参数是必须的
relay-log-info-repository = table              # 这个参数是必须的
relay_log_recovery= 1
relay_log_purge=0                              #关闭清除中继日志
# 下面这3个参数要在mysql第一次启动成功后,安装了半同步插件后在打开,然后在重启mysql,不然后面重启配置就会失效。
#loose_rpl_semi_sync_master_enabled=1          #开启半同步
#loose_rpl_semi_sync_slave_enabled=1
#loose_rpl_semi_sync_master_timeout=1000       #设置超时时间


#以下参数根据服务器性能调整
sync_relay_log=1                               #默认值是10000
sync_relay_log_info=1                          #默认值是10000
sync_master_info = 1                           #默认值是10000




[client]
socket=/run/mysqld/mysqld.sock